using System.ComponentModel;
using System.Globalization;
using System.Windows;
using System.Windows.Media;
using Meebey.SmartIrc4net;

namespace Thunder.IrcClient.MessageParser.Default
{
    /// <summary>
    /// Handles the MOTD message 
    /// </summary>
    internal class MessageParserMOTD : MessageParser
    {
        /// <summary>
        /// Gets the type of message handled by the parser
        /// </summary>
        public override ReceiveType MessageType
        {
            get { return ReceiveType.Motd; }
        }

        /// <summary>
        /// This method is invoked during message parsing.
        /// </summary>
        /// <param name="args">The <see cref="CancelMessageProcessingEventArgs"/> containing the message to be passed</param>
        /// <remarks>You can cancel further processing of the message by setting the <see cref="CancelEventArgs.Cancel"/> to true</remarks>
        protected override void ParseCore(CancelMessageProcessingEventArgs args)
        {
            this.Manager.WriteText(string.Empty, string.Format(CultureInfo.CurrentCulture, "<#{0}> {1}", Localized.UserNameMotd, args.MessageData.Message), Colors.Black, FontWeights.Black, FontStyles.Italic);
        }
    }
}